<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .one{
            padding: 0px;
            background-color: #f00;
            margin-bottom: 50px;
        }
        .two{
            padding: 0px;
            background-color: #f0f;
            margin-top: 50px;

        }
        .three{
            padding: 0px;
            background-color: aqua;
            margin-right:50px ;
        }
        .four{
            padding: 0px;
            background-color: darkcyan;
            margin-left: 50px;
        }
        /*垂直方向上的margin会触发高度坍塌
        即 上下两个元素的margin 只会以较大的值为准
        而水平方向上的margin则没有这种现象*/
    </style>
</head>
<body>
<div class="one">
    AAAAAA
</div>
<div class="two">
    BBBBBB
</div>
<span class="three">CCCC</span>
<span class="four">DDDD</span>
</body>
</html>